<template>
  <div class="alert_cover_conatiner"
  v-show="show">
    <div class="alert_container">
      <div class="alert_wrapper">
        <div class="alert_title">
          <div>{{title}}</div>
          <div><button @click="close">关闭</button></div>
        </div>
        <div class="alert_content">{{content}}</div>
        <div class="alert_handle">
          <button @click="oncancel">取消</button>
          <button @click="onconfirm">确定</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      show:false,
      title:"标题111",
      content:"请添加提示的内容",
      confirm:()=>{},
      cancel:()=>{}
    }
  },
  methods:{
    close(){
      this.show = false;
    },
    onconfirm(){
      this.confirm();
      this.close();
    },
    oncancel(){
      this.cancel();
      this.close();
    }
  }

}
</script>

<style scoped>
.alert_cover_conatiner
{
  width: 100vw;
  height: 100vh;
  position: fixed;
  left: 0px;
  top: 0px;
  background-color: rgba(0, 0, 0, 0.4);
}

.alert_container
{
  width: 100%;
  height: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.alert_wrapper
{
  width: 300px;
  display: inline-flex;
  justify-content: center;
  align-items: flex-start;
  background-color: white;
  flex-wrap: wrap;
  border-radius: 4px;
}

.alert_title,.alert_content,.alert_handle
{
  width: 90%;
  margin: 10px 0px;
}

.alert_title
{
  /* width: 90%; */
  font-size: 20px;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
}

.alert_content
{
  font-size: 16px;
  word-break: break-all;
}

.alert_handle
{
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
}

.alert_handle button
{
  margin-left: 10px;
}
</style>